<template>
    <div>
        <h1>入党申请人公示</h1>
        <ul>
            <li v-for="stu in appliers">{{ stu.name }}</li>
        </ul>
    </div>
    
</template>
<script>
import {ref, computed} from "vue"
export default{
    name:'Publicity',
    components:{

    },
    setup(){
        const students=[
            {name:'张三',isApply:true,is18:true},
            {name:'张三',isApply:true,is18:true},
            {name:'张三',isApply:true,is18:true},
            {name:'张三',isApply:true,is18:true},
            {name:'张三',isApply:true,is18:true},
            {name:'张三',isApply:true,is18:true},
            {name:'张三',isApply:true,is18:true},
            {name:'张三',isApply:true,is18:true},
            {name:'张三',isApply:true,is18:true},
            {name:'张三',isApply:true,is18:true},
            {name:'张三',isApply:true,is18:true},
            {name:'张三',isApply:true,is18:true},
            {name:'张三',isApply:true,is18:true},
        ]
        const appliers=computed(()=>{
            console.log('计算属性触发')
            return students.filter(stu=>stu.isApply & stu.is18)
        })
        return{
            students,
            appliers
        }
    }
}
</script>